package controller;

import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;
import java.util.List;

public class UsersController {
    /**
     * 服务对象
     */
    @Resource
    private UsersService usersService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("/getUserById")
    public Users selectOne(Integer id) {
        return this.usersService.queryById(id);
    }

    @GetMapping("/getUserList")
    public List<Users> getUserList(Users users) {
        return this.usersService.queryAll(users);
    }
}
